<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        main {
            position: fixed;
            left: 0;
            top: 0;
            bottom: 0;
            right: 0;
            margin: auto;
            width: 800px;
            height: 230px;
            display: flex;
            justify-content: space-evenly;
            align-items: center;
        }

        img {
            width: 120px;
            height: 230px;
        }

        span {
            line-height: 230px;
            font-weight: 1000;
            font-size: xx-large;
        }
    </style>
</head>

<body>
    <main>
        <img src="" alt="">
        <img src="" alt="">
        <span>:</span>
        <img src="" alt="">
        <img src="" alt="">
        <span>:</span>
        <img src="" alt="">
        <img src="" alt="">
    </main>
</body>
<script>
    var imgs = document.getElementsByTagName("img")
    setInterval(function () {
        var date = new Date()
        var h = date.getHours()
        var m = date.getMinutes()
        var s = date.getSeconds()
        // 小时
        var hShi = parseInt(h / 10)
        var hGe = h % 10
        // 分钟
        var mShi = parseInt(m / 10)
        var mGe = m % 10

        var sShi = parseInt(s / 10)
        var sGe = s % 10
        imgs[0].src = '../day10/img/' + hShi + '.png'
        imgs[1].src = '../day10/img/' + hGe + '.png'

        imgs[2].src = '../day10/img/' + mShi + '.png'
        imgs[3].src = '../day10/img/' + mGe + '.png'
        // 
        imgs[4].src = '../day10/img/' + sShi + '.png'
        imgs[5].src = '../day10/img/' + sGe + '.png'
    }, 1000);
</script>

</html>